/* eslint-disable indent */
let Home = (resolve) => {
    import('@/views/Home').then((moudle) => {
        resolve(moudle)
    })
}

let lose = (resolve) => {
    import('@/views/404').then((moudle) => {
        resolve(moudle)
    })
}
let logIn = (resolve) => {
    import('@/views/LogIn').then((moudle) => {
        resolve(moudle)
    })
}
let routes = [
    {
        path: '/home',
        name: 'home',
        // component: resolve => require(['@/components/HelloWorld'], resolve)
        component: resolve => require(['@/views/Home'], resolve)
    },
    {
        /* path: '/',
         name: 'home',
          */
        path: '/', redirect: {name: 'logIn'}
    },
    {
        path: '/User',
        component: Home,
        name: '用户管理',
        show: true,
        meta: '',
        iconCls: 'iconfont el-icon-cms-account',
        children: [
            {
                path: '/User/UserList',
                component: resolve => require(['@/views/User/UserList'], resolve),
                show: true,
                name: '用户列表'
            }, {
                path: '/User/GroupList',
                component: resolve => require(['@/views/User/GroupList'], resolve),
                show: true,
                name: '群列表'
            }
        ]
    },
    {
        path: '/post',
        component: Home,
        name: '动态管理',
        show: true,
        meta: '',
        iconCls: 'iconfont el-icon-cms-iconfontdongtai',
        children: [
            {
                path: '/post/ImageList',
                component: resolve => require(['@/views/Post/ImageList'], resolve),
                // show: true,
                name: '照片管理'
            }, {
                path: '/post/postList',
                component: resolve => require(['@/views/Post/postList'], resolve),
                show: true,
                name: '动态列表'
            }, {
                path: '/post/commentList',
                component: resolve => require(['@/views/Post/commentList'], resolve),
                show: true,
                name: '评论列表'
            }
        ]
    },
    {
        path: '/article',
        component: Home,
        name: '文章管理',
        show: true,
        meta: '',
        iconCls: 'iconfont el-icon-cms-wenzhang',
        children: [
            {
                path: '/article/list',
                component: resolve => require(['@/views/article/articleList'], resolve),
                show: true,
                name: '文章列表'
            }, {
                path: '/article/click',
                component: resolve => require(['@/views/article/articleClickCount'], resolve),
                // show: true,
                name: '文章点击数'
            }, {
                path: '/article/editor',
                component: resolve => require(['@/views/article/articleEditor'], resolve),
                // show: true,
                name: '文章编辑'
            }
        ]
    },
    {
        path: '/notice',
        component: Home,
        name: '通知管理',
        show: true,
        meta: '',
        iconCls: 'iconfont el-icon-cms-remind',
        children: [
            {
                path: '/notice/list',
                component: resolve => require(['@/views/Notice/NoticeList'], resolve),
                show: true,
                name: '通知列表'
            }
        ]
    }, {
        path: '/carousel',
        component: Home,
        name: '轮播图',
        show: true,
        meta: '',
        iconCls: 'iconfont el-icon-cms-pic',
        children: [
            {
                path: '/carousel/list',
                component: resolve => require(['@/views/carousel/carouselList'], resolve),
                show: true,
                name: '轮播图列表'
            }
        ]
    }, {
        path: '/admin',
        component: Home,
        name: '管理员',
        show: true,
        meta: '',
        iconCls: 'iconfont el-icon-cms-account',
        children: [
            {
                path: '/admin/list',
                component: resolve => require(['@/views/Admin/AdminList'], resolve),
                show: true,
                name: '管理员列表'
            }
        ]
    },
    {
        path: '/logIn',
        name: 'logIn',
        component: logIn
    },
    {
        path: '/*',
        component: lose
    }
]
export default routes
